Skip to main content
Version: 1.3.0

Media Service API Documentation

Endpoint

  • Method: POST
  • Path: https://api.kadal.ai/media-services/api/v1/
  • Summary: Extracts transcription, description, metadata, and thumbnail from a media file.

Description

This endpoint processes a single audio or video file to generate multiple outputs, including transcription of speech, a descriptive summary, technical metadata, and a thumbnail image. It enables comprehensive analysis and representation of media content in a single request.

Request

  • Content-Type: multipart/form-data

Payload

ParameterDescriptionData TypeIs Optional
choice_model_selectionAI model selection (whisper)StringNo
media_typeSelect the type of uploaded file (audio/video)StringNo
input_mediaUpload a single audio/video fileFile (.mp3, .mp4, .mpeg, .wav, .webm)No
descriptionEnable detailed description generationbooleanYes
description_lengthDesired length of generated description (25-500)integerYes
metadataEnable metadata generationbooleanYes
thumbnailEnable thumbnail generation (only supported for video files)booleanYes

Response

{
"status_code": 200,
"message": "SUCCESS::MediaService generated successfully",
"file_name": "Your filename will appear here",
"transcription": "Transcription will appear here",
"description_text": "Description will appear here",
"metadata_output": {
"title": "Title will appear here",
"description": "Description will appear here",
"genre": ["Genre will appear here"],
"creator": "Creator will appear here",
"keywords": ["Keywords will appear here"],
"custom": "custom will appear here"
},
"thumbnail_output": "Thumbnail will appear here"
}

Usage

import requests

url = "https://api.kadal.ai/media-services/api/v1/"
file_path = "your file path here"
token = "your token here"

headers = {
"accept": "application/json",
"Authorization": f"Bearer {token}",
}

data = {
"choice_model_selection": "whisper",
"media_type": "audio",
"description": "true",
"description_length": "225",
"metadata": "true",
"thumbnail": "false",
}

files = {
"input_media": (file_path, open(file_path, "rb"), "audio/wav"),
}

response = requests.post(url, headers=headers, data=data, files=files)